﻿<navigation:Page x:Class="LEEAAttendanceControl.Views.Jobs"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
           xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
           xmlns:my="clr-namespace:LEEAAttendanceControl.Web.Services"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="Jobs">
    <Grid x:Name="LayoutRoot">
        <ScrollViewer VerticalScrollBarVisibility="Auto">
            <StackPanel Orientation="Vertical">
                <riaControls:DomainDataSource x:Name="JobsDataSource" QueryName="GetJobs" AutoLoad="True" PageSize="10"
                                              LoadSize="20" LoadingData="JobsDataSource_LoadingData">
                    <riaControls:DomainDataSource.DomainContext>
                        <my:LEEAContext/>
                    </riaControls:DomainDataSource.DomainContext>
                </riaControls:DomainDataSource>

                <Grid Background="#404041">
                    <TextBlock Text="Jobs" FontSize="16" FontWeight="Bold" Foreground="White" Margin="5,3,3,2"
                               HorizontalAlignment="Left"/>
                </Grid>
                
                <sdk:DataGrid x:Name="JobsGrid" AutoGenerateColumns="False" IsReadOnly="True"
                              ItemsSource="{Binding Data, ElementName=JobsDataSource}">
                    <sdk:DataGrid.Columns>
                        <sdk:DataGridTemplateColumn Header="Job ID" CanUserReorder="True" CanUserResize="True" Width="150">
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <sdk:Label x:Name="CustomIDLabel" Content="{Binding CustomJobID}" Margin="5,0,0,0"
                                               VerticalAlignment="Center" HorizontalAlignment="Left" Height="25"/>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                        <sdk:DataGridTemplateColumn Header="Job Name" CanUserReorder="True" CanUserResize="True" Width="280">
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <sdk:Label x:Name="JobNameLabel" Content="{Binding JobName}" Margin="5,0,0,0"
                                               VerticalAlignment="Center" HorizontalAlignment="Left"/>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                        <sdk:DataGridTemplateColumn Header="Description" CanUserReorder="True" CanUserResize="True"
                                                    Width="353">
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <sdk:Label x:Name="DescriptionLabel" Content="{Binding Description}" Margin="5,0,0,0"
                                               VerticalAlignment="Center" HorizontalAlignment="Left"/>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                    </sdk:DataGrid.Columns>
                </sdk:DataGrid>
                
                <sdk:DataPager x:Name="JobsPager" PageSize="10" Source="{Binding Data, ElementName=JobsDataSource}"/>
            </StackPanel>
        </ScrollViewer>
    </Grid>
</navigation:Page>
